FROM crpi-swj5c6xc6lp13r2i.cn-hangzhou.personal.cr.aliyuncs.com/smart-aiops/golang:1.21-alpine as builder
WORKDIR /app
COPY . /app
RUN go env -w GOPROXY=https://goproxy.cn
RUN go build -o tcp-proxy

FROM crpi-swj5c6xc6lp13r2i.cn-hangzhou.personal.cr.aliyuncs.com/smart-aiops/alpine:latest
WORKDIR /app
COPY --from=builder /app/tcp-proxy .
COPY --from=builder /app/tcp_proxy.yaml .
CMD ["./tcp-proxy"]